package com.mxpio.erp.common.inventory.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.mxpio.erp.common.jpa.policy.ResCodeGeneratorPolicy;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.Dept;
import com.mxpioframework.security.entity.User;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_INV_WAREHOUSE")
@Schema(description="仓库")
public class Warehouse extends BaseEntity {

	private static final long serialVersionUID = 1L;
	
	@Id
	@Generator(policy = ResCodeGeneratorPolicy.class)
	@Column(name = "WH_CODE_", updatable = false)
	@Schema(description = "仓库编号")
	private String whCode;
	
	@Column(name = "WH_NAME_")
	@Schema(description = "仓库名称")
	private String whName;
	
	@Column(name = "WH_KEEPER_")
	@Schema(description = "仓管员")
	@Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
	private String keeper;
	
	@Column(name = "DEPT_CODE_")
	@Schema(description = "所属部门")
	@Dict(dicCode = "deptCode", dicEntity = Dept.class, dicText = "deptName")
	private String deptCode;
	
	@Column(name = "WH_PRICING_")
	@Schema(description = "定价策略")
	@Dict(dicCode = "ERP_INV_WH_PRICING")
	private String whPricing;
	
	@Column(name = "WH_TYPE_")
	@Schema(description = "仓库类别")
	@Dict(dicCode = "ERP_INV_WH_TYPE")
	private String whType;
	
	@Column(name = "SETTLE_STATUS_")
	@Schema(description = "是否核算")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String settleStatus;
	
	@Column(name = "MRP_STATUS_")
	@Schema(description = "是否参与MRP")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String mrpStatus;
	
	@Column(name = "WH_STATUS_")
	@Schema(description = "是否启用")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String whStatus;

	@Column(name = "MEMO_")
	@Schema(description = "备注")
	private String memo;
}
